Skip to content

Default --credential-auto to true when --credential-provider is set alone#152

Merged
masnwilliams merged 3 commits intomainfrom
masnwilliams/default-credential-auto-lookup
Apr 29, 2026
Merged

Default --credential-auto to true when --credential-provider is set alone#152
masnwilliams merged 3 commits intomainfrom
masnwilliams/default-credential-auto-lookup

Conversation

@masnwilliams
Copy link
Copy Markdown
Contributor

@masnwilliams masnwilliams commented Apr 20, 2026

Summary

  • kernel auth connections create --domain foo.com --credential-provider my-1p currently builds a CredentialReference of { provider: "my-1p" } with no path and no auto flag. The API accepts that as a valid-but-inert reference, so the managed auth session never fetches credentials and dead-ends in awaiting_input (user gets prompted for manual input).
  • Default auto: true in that branch to match the dashboard's UX (create-managed-auth-dialog.tsx), where picking a provider without a specific item always means "look up by domain".
  • Explicit --credential-path still pins the reference (no implicit auto). Explicit --credential-auto is now redundant but still honored.
  • Update the help text to document the new default.

Companion API/workflow fix: https://github.com/kernel/kernel/pull/1794 — without that PR, even a correctly-sent auto: true is ignored by the CUA managed auth path.

Test plan

  • go build ./...
  • go test ./cmd/ -count=1 (full suite passes; 4 new focused cases)
  • New cases pin all four branches:
    • --credential-provider alone → auto: true defaulted
    • --credential-provider + --credential-path → no implicit auto
    • --credential-provider + --credential-auto → auto honored
    • --credential-name → unaffected by auto default
  • Smoke: against staging, run kernel auth connections create --domain google.com --profile-name pn --credential-provider my-1p and confirm the resulting connection resolves credentials without prompting.

Made with Cursor


Note

Low Risk
Small CLI request-mapping change with targeted tests; primary risk is a behavior change for users who previously relied on provider-only meaning “no lookup,” which is unlikely/intended to be inert anyway.

Overview
Fixes kernel auth connections create so that providing --credential-provider without --credential-path implicitly sets credential.auto=true, avoiding a valid-but-inert credential reference that would stall managed auth sessions.

Updates the --credential-auto flag help text to document the new default, and adds focused regression tests covering provider-only, provider+path, explicit --credential-auto, and --credential-name branches.

Reviewed by Cursor Bugbot for commit 39c0423. Bugbot is set up for automated code reviews on this repo. Configure here.

…lone

auth connections create accepted --credential-provider without
--credential-path or --credential-auto and dutifully sent a
CredentialReference of { provider } with no auto flag. The server
accepted that as valid but never fetched credentials, so managed
auth sessions dead-ended in awaiting_input and the user was prompted
to enter credentials manually.

Match the dashboard's UX (create-managed-auth-dialog.tsx): picking a
provider without a specific item always means "look up by domain".
An explicit --credential-path still pins the reference, and passing
--credential-auto is now redundant but still honored.

Covered by four new cases in auth_connections_test.go.

Made-with: Cursor
@firetiger-agent
Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

Any PR that changes the kernel API. Monitor changes to API endpoints (packages/api/cmd/api/) and Temporal workflows (packages/api/lib/temporal) in the kernel repo

Reason: PR modifies CLI command behavior in the auth package, not API endpoints (packages/api/cmd/api/) or Temporal workflows (packages/api/lib/temporal) as specified in the filter.

To monitor this PR anyway, reply with @firetiger monitor this.

@masnwilliams masnwilliams requested a review from hiroTamada April 29, 2026 19:26
@masnwilliams masnwilliams merged commit b95f794 into main Apr 29, 2026
7 checks passed
@masnwilliams masnwilliams deleted the masnwilliams/default-credential-auto-lookup branch April 29, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants